package com.github.why168;

import jdk.nashorn.internal.runtime.JSONFunctions;

import java.util.Map;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class HashMap {

    public static void main(String[] args) {
        java.util.HashMap<String, Object> hashMap = new java.util.LinkedHashMap<>();
        hashMap.put("11", "2");
        hashMap.put("20", "2");
        hashMap.put("2", "2");
        for (Map.Entry<String, Object> entry : hashMap.entrySet()) {
            String key = entry.getKey();
            Object value = entry.getValue();
            System.out.printf("k:%s , v:%s\n", key, value);
        }
        java.util.TreeMap<String, Object> treeMap = new java.util.TreeMap<>();


        CopyOnWriteArrayList

        String s = "12312312321";
        s.lastIndexOf("21");


        String content = "CV >= \"GM5.23423_Android\"";
        String pattern = "CV >= \"GM(.*)_Android";
        Pattern compile = Pattern.compile(pattern);
        Matcher matcher = compile.matcher(content);
        if (matcher.find()) {
            for (int i = 0; i <= matcher.groupCount(); i++) {
                System.out.println("Found value: " + matcher.group(i));
            }
        }

    }
}
